def power_of_four(num):
    if num == 1: return True
    if num < 4: return False
    if num&(num-1): return False
    return not num & 0b01010101010101010101010101010101